package com.tianji.api.client.remark.fallback;

import com.tianji.api.client.remark.RemarkClient;
import com.tianji.common.utils.CollUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;

import java.util.Set;

/**
 * @author Administrator
 * @version 1.0
 * @description: TODO
 * @date 2024/8/26 11:49
 */
@Slf4j
public class RemarkClientFallback implements FallbackFactory<RemarkClient> {

    @Override
    public RemarkClient create(Throwable cause) {
        return new RemarkClient() {
            /**
             * 根据业务ID集合查询点赞状态
             */
            @Override
            public Set<Long> isLiked(Iterable<Long> bizIds) {
                log.error("远程调用remark微服务异常，接口：根据业务ID查询点赞状态，异常信息：{}", cause);
                return CollUtils.emptySet();
            }
        };
    }
}
